package com.define.ssh.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

/**
 * compdept entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "compdept")
public class Compdept implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer id;
	private Company company;
	private String deptname;
	private Integer pid;
	private Date updateTime;
	private Integer updatetype;//更新类型 1.新增 2.修改 3.删除
	private Integer sortmanager;
	private String tel;
	
	

	// Constructors

	/** default constructor */
	public Compdept() {
	}

	// Property accessors
	@GeneratedValue(generator = "generator")
	@Id
	@GenericGenerator(name = "generator", strategy = "identity")
	@Column(name = "id", unique = true, nullable = false, precision = 20, scale = 0)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "compid", unique = false, nullable = true, insertable = true, updatable = true)
	public Company getCompany() {
		return this.company;
	}

	public void setCompany(Company company) {
		this.company = company;
	}

	@Column(name = "deptname", unique = false, nullable = true, insertable = true, updatable = true, length = 32)
	public String getDeptname() {
		return this.deptname;
	}

	public void setDeptname(String deptname) {
		this.deptname = deptname;
	}

	@Column(name = "pid", unique = false, nullable = false, insertable = true, updatable = true)
	public Integer getPid() {
		return this.pid;
	}

	public void setPid(Integer pid) {
		this.pid = pid;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "update_time", unique = false, nullable = false, insertable = true, updatable = true, length = 19)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name = "updatetype", unique = false, nullable = false, insertable = true, updatable = true)
	public Integer getUpdatetype() {
		return this.updatetype;
	}

	public void setUpdatetype(Integer updatetype) {
		this.updatetype = updatetype;
	}

	@Column(name = "sortmanager", unique = false, nullable = false, insertable = true, updatable = true)
	public Integer getSortmanager() {
		return this.sortmanager;
	}

	public void setSortmanager(Integer sortmanager) {
		this.sortmanager = sortmanager;
	}

	@Column(name = "tel", unique = false, nullable = true, insertable = true, updatable = true, length = 20)
	public String getTel() {
		return this.tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	
	

}